package com.gxa.web_admin.controller.operationscontroller;

import com.gxa.common.R;
import com.gxa.modules.service.operationsservice.PnZuHuXinXiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Company
 * @Classname PnZuHuXinXiController
 * @Description TODO
 * @Author pn
 * Date 2022-05-10 9:49
 * Version 1.0
 */
@Api(value = "租户信息管理", tags = "后台-租户管理-租户信息管理接口API_pn")
@RestController
@RequestMapping("/zuHuXinXi")
public class PnZuHuXinXiController {

    @Autowired
    PnZuHuXinXiService pnZuHuXinXiService;

    @GetMapping("/selectZuHuXinXi")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页面码",required = true,paramType = "query",dataType = "int"),
            @ApiImplicitParam(name = "limit",value = "显示条数",required = true,paramType = "query",dataType = "int"),
            @ApiImplicitParam(name = "tenantName",value = "租户名称",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "buildName",value = "所属楼宇",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "roomName",value = "房间名称",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "socialNum",value = "社会信用代码",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "userName",value = "负责人",paramType = "query",dataType = "String"),
            @ApiImplicitParam(name = "phone",value = "联系电话",paramType = "query",dataType = "String")
    })
    public R selectZuHuXinXi(String tenantName,String buildName,String roomName,String socialNum,String userName,String phone,int page,int limit){
        return pnZuHuXinXiService.selectZuHuXinXi(tenantName,buildName,roomName,socialNum,userName,phone,page,limit);
    }

    @GetMapping("/selectBuild")
    @ApiOperation(value = "所属楼宇下拉接口-pn", notes = "下拉接口", httpMethod = "GET", response = Map.class)
    public R selectBuild(){
        return pnZuHuXinXiService.selectBuild();
    }

    @PostMapping("/deleteByIds")
    @ApiOperation(value = "删除数据接口（单条 1；多条 1,2)-pn", notes = "删除数据", httpMethod = "POST", response = Map.class)
    @ApiImplicitParam(name = "ids",value = "删除数据的id/s",paramType = "query",dataType = "String")
    public R deleteByIds(String ids){
        return pnZuHuXinXiService.deleteByIds(ids);
    }
}

